package com.dubbo.demo.service;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.dubbo.demo.entity.User;



@Path("user")//RestDubbo接口必须标示path，不然启动报错
public interface TestService {
	@GET
	@Path("testRestDubbo")
	@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})//指定输出json和xml格式
	@Consumes({"application/json", "text/xml"})//指定接收json和xml格式
	public User testSayDubbo();

	@GET
	@Path("testRestSay/{name}")
	@Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"})//支持中文
	@Consumes({"application/json", "text/xml"})//指定接收json和xml格式
	public String say(@PathParam("name")String name);
}
